package pop3Server;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class ReadMail {
	
	private BufferedReader br = null;
	
	public ReadMail(){
		
	}
	
	public boolean readMail(PrintWriter pw,String fileName){
		boolean flag=false;
		try {
			br=new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
			String str=null;
			while((str=br.readLine())!=null){
				pw.println(str);
				pw.flush();
			}
			br.close();
			flag=true;
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return flag;
	}

}
